<?php

namespace app\models\user;

use Yii;

/**
 * This is the model class for table "user_bank".
 *
 * @property int $id
 * @property int $user_id
 * @property string $bank_number 卡号
 * @property string $bank_name 银行名
 * @property string $nickname 卡姓名
 * @property string $mobile 预留手机
 */
class UserBank extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'user_bank';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['user_id'], 'integer'],
            [['bank_name'], 'required'],
            [['bank_number'], 'string', 'max' => 50],
            [['bank_name', 'nickname', 'mobile'], 'string', 'max' => 255],

            [['bank_x'], 'safe']
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => 'User ID',
            'bank_number' => 'Bank Number',
            'bank_name' => 'Bank Name',
            'nickname' => 'Nickname',
            'mobile' => 'Mobile',
        ];
    }
}
